<template>
	<view class="profile-wrap">
		<view class="profile-wrap-header">
			<uni-nav-bar :statusBar="true" leftIcon="arrowleft" fixed="true" title="食堂概况" @clickLeft="clickLeft"></uni-nav-bar>
		</view>
		<view class="profile-wrap-content">
			<video-supervise :list="videoAreaList"></video-supervise>
		</view>
	</view>
</template>

<script>
	import VideoSupervise from '../../components/VideoSupervise/VideoSupervise.vue'
	export default {
		components: {VideoSupervise},
		data() {
			return {
				departmentId: this.$store.getters.departmentId,
				videoAreaList: []
			}
		},
		onLoad(option) {
			this.departmentId = option.departmentId
			this.init()
			console.log('departmentId', this.departmentId)
		},
		methods: {
			clickLeft() {
				uni.navigateBack({
					delta: 1,
					animationType: 'pop-out',
					animationDuration: 200
				})
			},
			init() {
				this.getVidoeProfileList()
			},
			getVidoeProfileList() {
				let params = {
					departmentId: this.departmentId
				}
				this.$request.ygstCameraRegionNumberList(params).then(res => {
					console.log('res', res)
					const data = res
					let areaIconList = ['camera', 'loop', 'map', 'navigate', 'scan', 'flag']
					if (data.length > 0) {
						for(let i = 0; i < data.length; i++) {
							data[i].iconType = areaIconList[i]
						}
						this.videoAreaList = data
					}
				})
			}
		}
	}
</script>

<style>

</style>
